#include <linux/init.h>
#include <linux/module.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip.h>
#include "../include/pub.h"
#include "nf_hook.h"
#include "uf_syscall.h"
#include "uf_rule.h"

MODULE_LICENSE("GPL");

static int UF_init(void)
{
    int ret = 0;
    
    /* netfilter-hook */
    ret = UF_NF_hook();
    if (0 != ret)
    {
        printk(KERN_EMERG"register hook fail!\r\n");
        return ret;
    }
    
    /* syscall */
    ret = UF_setsyscall();

    UF_rule_init();
    
    printk(KERN_EMERG"install urlfilter succ!\r\n");
    
    return 0;
}

static void UF_exit(void)
{
    printk(KERN_EMERG"uninstall urlfilter succ!\r\n");
    UF_NF_unhook();
    UF_resetsyscall();
    UF_rule_exit();
    return ;
}

module_init(UF_init);
module_exit(UF_exit);

